# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgbase=futuresql
pkgname=($pkgbase-qt5 $pkgbase-qt6)
pkgver=0.1.1
pkgrel=2
pkgdesc='Non-blocking Qt database framework'
arch=(loong64 x86_64)
url='https://api.kde.org/futuresql/html/index.html'
license=(LGPL)
makedepends=(extra-cmake-modules qt5-base qt6-base)
source=(https://download.kde.org/stable/$pkgname/$pkgbase-$pkgver.tar.xz{,.sig})
sha256sums=('e44ed8d5a9618b3ca7ba2983ed9c5f7572e6e0a5b199f94868834b71ccbebd43'
            'SKIP')
validpgpkeys=(C3D7CAFBF442353F95F69F4AA81E075ABEC80A7E) # Jonah Brüchert <jbb@kaidan.im>

build() {
  cmake -B build5 -S $pkgbase-$pkgver \
    -DQT_MAJOR_VERSION=5 \
    -DBUILD_TESTING=OFF \
    -DCMAKE_SKIP_RPATH=ON
  cmake --build build5

  cmake -B build6 -S $pkgbase-$pkgver \
    -DQT_MAJOR_VERSION=6 \
    -DBUILD_TESTING=OFF \
    -DCMAKE_SKIP_RPATH=ON
  cmake --build build6 
}

package_futuresql-qt5() {
  depends=(qt5-base)
  conflicts=(futuresql)
  provides=(futuresql)
  replaces=(futuresql)

  DESTDIR="$pkgdir" cmake --install build5
}

package_futuresql-qt6() {
  depends=(qt6-base)

  DESTDIR="$pkgdir" cmake --install build6
}
